#!/usr/bin/env python
# Create: 2019/1/17
__author__ = '749B'


def check(urls, starts, ends):
    li = []
    length = None
    for i in urls:
        url = i
        # 检查长度
        if length is None:
            length = len(url)
        else:
            if len(url) != length:
                raise UserWarning("长度验证错误:", url)
        # 检查前缀
        if not url.startswith(starts):
            raise UserWarning("前缀验证错误:", url)
        # 检查后缀
        if not url.endswith(ends):
            raise UserWarning("后缀验证错误:", url)
        # 检查重复
        if url in li:
            raise UserWarning("发现重复的url:", url)
        else:
            li.append(url)
    print("url 重复检查通过")

